home *** CD-ROM | disk | FTP | other *** search
- Path: hypatia.pec.co.nz!JohnM
- From: JohnM@hypatia.pec.co.nz (John Marshall)
- Newsgroups: comp.lang.c++
- Subject: Re: Coding Standards
- Date: 22 Mar 1996 01:00:13 GMT
- Organization: PEC (NZ) Ltd.
- Message-ID: <4isu2t$opo@janus.pec.co.nz>
- References: <4hj8ek$elu@sam.inforamp.net> <4hktar$5o2@galaxy.ucr.edu> <4hmqol$97j@abacus.abasoft.co.uk> <4hsg8r$pmm@sam.inforamp.net> <4i9o6j$p4l@daisy.pgh.wec.com> <4idskb$pc1@sam.inforamp.net> <314EBD08.43BC@virtus.com> <4io2i7$n9v@sam.inforamp.net>
- Reply-To: johnm@pec.co.nz
- NNTP-Posting-Host: hypatia.pec.co.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- Randy Charles Morin (rmorin@inforamp.net) wrote:
- >>> -access functions are to be inline.
- >>> This is the biggest fallacy in programming today. If you make your
- >>> accessors inline, then you have defeated the purpose of data hiding. If
- >>> your data's type changes, then you still have to recompile every object
- >>> that accesses the member.
- >>
- >> Agreed.
- > Thank you. I have a hard time convincing anybody of this.
-
- I think you have a hard time convincing anybody of this because it's
- not true. It seems to me that "data hiding" has to do with the actual
- *text* of clients' source code, and that recompilation is merely an
- implementation detail.
-
- If we had really defeated the purpose of data hiding, the statement
- would be: "if your data's type changes, then you have to rewrite all the
- clients". This is not the case when accessors are functions which just
- happen to be inline.
-
- Of course, in practice, all that recompilation during development is a
- major pain. I guess that's why people put what are going to be inline
- accessors in library.inc, and include library.inc in either library.cpp
- or (for inlining) library.hpp, dependant on whether it's a "dev make" or
- "production make" respectively. Certainly they're implementation -- they
- don't *belong* directly in the header file.
-
- Seems to me that the fundamental problem is that include files are
- inherently broken compared to more automatic ways of managing the required
- information. Alas.
-
- --
- John Marshall <johnm@pec.co.nz>
- PEC (NZ) Ltd, Marton, New Zealand.
-